package j_composite.a_design_pattern;

/**
 * Created by wug on 2016/7/14 0014.
 * 叶子节点
 */
public class Leaf extends Component {

    public Leaf(String name) {
        super.name = name;
    }

    @Override
    public void operation() {
        System.out.println("-"+name);
    }

    @Override
    public Component add(Component component) {
        throw new UnsupportedOperationException();
    }

    @Override
    protected Component remove(Component component) {
        throw new UnsupportedOperationException();
    }

    @Override
    protected Component getChild(int i) {
        throw new UnsupportedOperationException();
    }
}
